import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
  // 禁用 eslint-plugin-vue 错误提示
  lintOnSave: false,
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  optimizeDeps: {
    include: [
      '@wangeditor/editor',
      '@wangeditor/editor-for-vue'
    ]
  },
  server: {
    port: 9012,
    host: true,
    proxy: {
      '/api': {
        target: 'http://localhost:9011',
        changeOrigin: true,
        rewrite: (path) => path,
      }
    }
  }
})
